﻿using FluentValidation;
using Mes.Application.DTO.Inputs.Operations;

namespace Mes.Application.Web.Validators.Process
{
    public class AddingProcessInputValidator : AbstractValidator<AddingProcessInput>
    {
        public AddingProcessInputValidator()
        {
            RuleFor(x => x.Process_Id).NotEmpty().WithMessage("工艺编码不能为空")
                                .Length(1, 40).WithMessage("工艺编码长度必须在1到40之间");
            RuleFor(x => x.Process_Desc).NotEmpty().WithMessage("工艺名称不能为空")
                               .Length(1, 80).WithMessage("工艺名称长度必须在1到80之间");
            RuleFor(x => x.Spare1).Length(0, 80).WithMessage("描述长度必须在0到80之间");
            RuleFor(x => x.Process_Ver_Id).Length(0, 40).WithMessage("版本长度必须在0到40之间");
            RuleFor(x => x.Notes).Length(0, 4096).WithMessage("备用长度必须在0到4096之间");
        }
    }
}
